global gdt_install
global idt_install
gdt_install:
    mov eax, [esp+4]  ; get gdt special pointer, passed as argument
    lgdt [eax]        ; load the gdt
    mov ax, 0x10      ; 0x10 (setup our data segment)
    mov ds, ax
    mov es, ax
    mov fs, ax
    mov gs, ax
    mov ss, ax
    jmp 0x08:flush2   ; 0x08 (setup our code segment)
flush2:
    ret               ; return to C

idt_install:
    mov eax, [esp+4]  ; get idt special pointer, passed as argument
    lidt [eax]        ; load the idt
    ret               ; done
